innerHTML is not a function

60

javascript create node from innerhtml -

function createElement( str ) {
    var frag = document.createDocumentFragment();

    var elem = document.createElement('div');
    elem.innerHTML = str;

    while (elem.childNodes[0]) {
        frag.appendChild(elem.childNodes[0]);
    }
    return frag;
}

innerHTML is not a function -

document.getElementById("dated").innerHTML = "blah"

innerHTML is not a function -

document.getElementById("dated").innerHTML = month + "/" + day + "/" + year;

change ul index value with innertext -

document.getElementsByClassName('buddyName')[3].innerHTML= "Aragorn";

Comments

Submit
0 Comments